package com.tianji.learning.controller.admin;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.NotePageDto;
import com.tianji.learning.domain.query.NotePageQuery;
import com.tianji.learning.domain.vo.NoteDetailVo;
import com.tianji.learning.service.INoteService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 课程笔记表 控制器
 * </p>
 *
 * @author chuanyun
 */
@Api(tags = "Note管理")
@RestController
@RequiredArgsConstructor
@RequestMapping("/admin/notes")
public class NoteAdminController {

    private final INoteService noteService;

    @GetMapping("/{id}")
    public NoteDetailVo getNoteDetailById(@PathVariable("id")Long id){
        return  noteService.getNoteDetailById(id);
    }

    @GetMapping("/page")
    public PageDTO<NotePageDto> selectNotePage(NotePageQuery query){
        return noteService.selectNotePage(query);
    }


}
